[gmp] Cleanup, fix cross-builds, switch windows from yasm to clang#27787
[gmp] Cleanup, fix cross-builds, switch windows from yasm to clang#27787BillyONeal merged 12 commits intomicrosoft:masterfrom
Conversation
f8842e7 to
1ee0428
Compare
ports/gmp/portfile.cmake
Outdated
There was a problem hiding this comment.
Is there a reason to not add this to PATH and keep the patch smaller ?
There was a problem hiding this comment.
CURRENT_HOST_INSTALLED_DIRis only for cross builds. For native builds, the tools are in.. So- This port originally copied the host tools to the build dirs to avoid patching.
- This PR uses the pattern I developed in [libgpg-error,libgcrpyt,libassuan,gpgme] Update, official mirrors, mingw, cross builds #27668: It transparently corrects the dependencies and executes the tool from its installed path. One benefit is that the path also clearly appears in the log.
There was a problem hiding this comment.
I think the reason to add it to the path is again the spaces issue.
There was a problem hiding this comment.
I see. But I wonder if space wouldn't cause problems in 200 other spots.
(I was already thinking about a PR which builds in /v pkg to see what breaks.)
I will check if I can use proper quotes.
There was a problem hiding this comment.
The gmp install step fails anyways when the install root or packages root contains space, and there is a warning:
CMake Warning at scripts/cmake/vcpkg_configure_make.cmake:203 (message):
Detected whitespace in root directory. Please move the path to one without
whitespaces! The required tools do not handle whitespaces correctly and the
build will most likely fail
The gmp build step fails anyways when the buildtrees contains space.
There was a problem hiding this comment.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 6f7ffeb18f99796233b958aaaf14ec7bd4fb64b2 -- versions
./vcpkg x-add-version --allDiff
diff --git a/versions/baseline.json b/versions/baseline.json
index 7428e7a..af37ffd 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2690,7 +2690,7 @@
},
"gmp": {
"baseline": "6.2.1",
- "port-version": 13
+ "port-version": 14
},
"gmsh": {
"baseline": "4.9.0",
diff --git a/versions/g-/gmp.json b/versions/g-/gmp.json
index 8fd6673..b301b77 100644
--- a/versions/g-/gmp.json
+++ b/versions/g-/gmp.json
@@ -1,5 +1,10 @@
{
"versions": [
+ {
+ "git-tree": "ff8dea9499f7141be457b57c4fef949a29aa941d",
+ "version": "6.2.1",
+ "port-version": 14
+ },
{
"git-tree": "28b5b46e27a69da50c1cd0a8be5d0a32cbca120b",
"version": "6.2.1",You have modified or added at least one portfile where deprecated functions are used.
Details
If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())
In the ports that use the new function, you have to add the corresponding dependencies:
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}The following files are affected:
ports/gmp/portfile.cmake
There was a problem hiding this comment.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 6f7ffeb18f99796233b958aaaf14ec7bd4fb64b2 -- versions
./vcpkg x-add-version --allDiff
diff --git a/versions/baseline.json b/versions/baseline.json
index 7428e7a..af37ffd 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2690,7 +2690,7 @@
},
"gmp": {
"baseline": "6.2.1",
- "port-version": 13
+ "port-version": 14
},
"gmsh": {
"baseline": "4.9.0",
diff --git a/versions/g-/gmp.json b/versions/g-/gmp.json
index 8fd6673..b45b8c2 100644
--- a/versions/g-/gmp.json
+++ b/versions/g-/gmp.json
@@ -1,5 +1,10 @@
{
"versions": [
+ {
+ "git-tree": "e8d9f78bbb94c735ce2a7d1f644dd552e20aebd4",
+ "version": "6.2.1",
+ "port-version": 14
+ },
{
"git-tree": "28b5b46e27a69da50c1cd0a8be5d0a32cbca120b",
"version": "6.2.1",You have modified or added at least one portfile where deprecated functions are used.
Details
If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())
In the ports that use the new function, you have to add the corresponding dependencies:
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}The following files are affected:
ports/gmp/portfile.cmake
There was a problem hiding this comment.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 6f7ffeb18f99796233b958aaaf14ec7bd4fb64b2 -- versions
./vcpkg x-add-version --allDiff
diff --git a/versions/baseline.json b/versions/baseline.json
index 7428e7a..af37ffd 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2690,7 +2690,7 @@
},
"gmp": {
"baseline": "6.2.1",
- "port-version": 13
+ "port-version": 14
},
"gmsh": {
"baseline": "4.9.0",
diff --git a/versions/g-/gmp.json b/versions/g-/gmp.json
index 8fd6673..cb1e324 100644
--- a/versions/g-/gmp.json
+++ b/versions/g-/gmp.json
@@ -1,5 +1,10 @@
{
"versions": [
+ {
+ "git-tree": "254ac1c99afc24f08c0932cb59d8a502785bc3fe",
+ "version": "6.2.1",
+ "port-version": 14
+ },
{
"git-tree": "28b5b46e27a69da50c1cd0a8be5d0a32cbca120b",
"version": "6.2.1",You have modified or added at least one portfile where deprecated functions are used.
Details
If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())
In the ports that use the new function, you have to add the corresponding dependencies:
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}The following files are affected:
ports/gmp/portfile.cmake
There was a problem hiding this comment.
You have modified or added at least one portfile where deprecated functions are used.
Details
If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())
In the ports that use the new function, you have to add the corresponding dependencies:
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}The following files are affected:
ports/gmp/portfile.cmake
| if test "$enable_shared" = yes; then | ||
| GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols" | ||
| - GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols" | ||
| - LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def" | ||
| - LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def" | ||
| + #LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def" | ||
| + #LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def" | ||
| + GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined" |
There was a problem hiding this comment.
hmm does the symbol export still work without these ?
There was a problem hiding this comment.
I checked this with mingw-dynamic: The import libs are present and not empty, only smaller (in particular the C++ lib).
AFAIU from the headers, there should be enough export declarations for the public API. Only the tests, fuzzers etc. might need some symbols which are not covered. But vcpkg doesn't build them.
And the package even takes care of putting the right definitions into the header for DLL import. Maybe this is why they don't allow simultaneous shared+static for Windows.
| # Flags used for preprocessing (in ansi2knr rules). | ||
| diff --git a/tests/Makefile.in b/tests/Makefile.in |
There was a problem hiding this comment.
Note: Makefile.in is generated from Makefile.am.
| if test "$enable_shared" = yes; then | ||
| GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols" | ||
| - GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols" | ||
| - LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def" | ||
| - LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def" | ||
| + #LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def" | ||
| + #LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def" | ||
| + GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined" |
There was a problem hiding this comment.
I checked this with mingw-dynamic: The import libs are present and not empty, only smaller (in particular the C++ lib).
AFAIU from the headers, there should be enough export declarations for the public API. Only the tests, fuzzers etc. might need some symbols which are not covered. But vcpkg doesn't build them.
And the package even takes care of putting the right definitions into the header for DLL import. Maybe this is why they don't allow simultaneous shared+static for Windows.
There was a problem hiding this comment.
You have modified or added at least one portfile where deprecated functions are used.
Details
If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())
In the ports that use the new function, you have to add the corresponding dependencies:
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}The following files are affected:
ports/gmp/portfile.cmake
|
Thanks for the gmp fixes! Happy to see yasm go bye bye bye |
What does your PR fix?
Cleanup, fix cross-builds. Fixes [gmp] Build error on x64-linux-dynamic #27469.
Switch MSVC asm from yasm to clang, enabling asm for arm64-windows (based on commits and comments in [gmp] arm64 windows asm optimization #26764, [gmp] Use clang instead of yasm #23660, but only tested in CI).
Add feature
fatfor runtime selection of optimized low level routines on x86, cf. https://gmplib.org/manual/Notes-for-Package-Builds.Which triplets are supported/not supported? Have you updated the CI baseline?
unchanged, no
Tested arm64-linux and mingw cross builds on x64-linux.
Does your PR follow the maintainer guide?
yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --alland committed the result?yes